﻿using System.Collections.Generic;


namespace UFrame
{
    public enum LanguageType
    {
        Chinese
    }

    public class Language
    {
        public static LanguageType LanType = LanguageType.Chinese;

        private static Dictionary<int, string> LanDic;

        public static void Init(Dictionary<int, string> lanDic)
        {
            LanDic = lanDic;
        }

        public static string Lang(int id, params object[] args)
        {
            if (id == 0)
            {
                return string.Empty;
            }

            if (!LanDic.ContainsKey(id))
            {
                return "" + id;
            }

            if (args == null || args.Length == 0)
            {
                return LanDic[id];
            }
            else
            {
                return string.Format(LanDic[id], args);
            }
        }
    }
}